<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <base href="<%=basePath%>">
    <meta name="description" content="easyui help you build your web page easily!">
    <title>jQuery EasyUI CRUD Demo</title>
    <link rel="stylesheet" type="text/css" href="../static/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../static/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="../static/easyui/demo.css">
    <script type="text/javascript" src="../static/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="../static/easyui/jquery.easyui.min.js"></script>
    <style type="text/css">
		#fm{
			margin:0;
			padding:10px 30px;
		}
		.ftitle{
			font-size:14px;
			font-weight:bold;
			color:#666;
			padding:5px 0;
			margin-bottom:10px;
			border-bottom:1px solid #ccc;
		}
		.fitem{
			margin-bottom:5px;
		}
		.fitem label{
			display:inline-block;
			width:80px;
		}
	</style>
</head>
<body>
<div>
    <input id="ss"></input>
    <div id="mm" style="width:120px">
        <div data-options="name:'all',iconCls:'icon-ok'">搜索</div>
    </div>
</div>
<table id="dg">
</table>
<script type="text/javascript">
    $("#ss").searchbox({
		searcher:function(value,name){
		alert(value + "," + name);
		},
		menu:'#mm',
		prompt:'Please Input Value'
	});

    $("#dg").datagrid({
    	url:"../../emp/findAllEmpMethod.do",
    	columns:[[
    		{field:'empno',title:'员工编号',width:100},
    		{field:'ename',title:'员工姓名',width:100},
    		{field:'job',title:'员工职位',width:100},
    		{field:'mgr',title:'上级编号',width:100},
    		{field:'hiredate',title:'入职时间',width:100,
    			formatter:function(time){//处理入职日期显示样式
    				var newTime=new Date(time);
    				var year=newTime.getFullYear();
    				var month=newTime.getMonth()+1;
    				var date=newTime.getDate();
    				return year+"年"+month+"月"+date+"日";
    			}
    		},
    		{field:'sal',title:'薪水',width:100},
    		{field:'comm',title:'佣金',width:100,
    			formatter:function(value){//处理奖金为null时显示为0
   					return value==null?0:value;
    			}
    		},
    		{field:'deptno',title:'部门编号',width:100},
    	]],
    	singleSelect:true,//每次只能选中一行
    	pagination:true,//分页工具栏
    	pageNumber:1,
	    pageList:[5,10,20,30,40,50],
    	/* queryParams: {//发送额外的参数
			pageSize:5,
		} */

    });
    </script>
</body>


</html>